package com.wp.dao;

import com.wp.config.SpringConfig;
import com.wp.entity.User;
import com.wp.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

public class App {
    public static void main(String[] args) {
        ApplicationContext at = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = at.getBean(UserService.class);
        userService.save();
        User user = userService.findById(1);
        System.out.println(user);
    }
}
